<template>
  <div id="recruitlist">
    <el-breadcrumb separator=">">
      <el-breadcrumb-item :to="{ path: '/' }">系统首页</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/recruit' }">公开招聘</el-breadcrumb-item>
    </el-breadcrumb>
    <section class="wboxs">
    <!--工具条-->
        <el-form :inline="true" :model="filters">
          <div>
            <el-form-item style="float:left">
              <span style="font-weight:bolder">2023年度第一批公开招聘</span>
            </el-form-item>
            <div style="float:right">
              <el-form-item label="单位名称">
                <el-input v-model="filters.unitName" placeholder="关键字" @change="searchList"></el-input>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="searchList" icon="el-icon-search">查询</el-button>
              </el-form-item>
            </div>
          </div>
        </el-form>
    </section>
    <section class="wboxd" style="margin-top:10px">
      <!--列表-->
      <h1>单位列表</h1>
      <el-table :data="selectionlist" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight" border id="selectionindexlist" row-key="personId"
        default-expand-all
        :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
        <el-table-column label="单位" prop="unitName">
        </el-table-column>
        <el-table-column label="计划申报" width="100">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateCandidateReport===2" content="办理完成" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateCandidateReport" @click="doit(scope.row.personId,12)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.stateCandidateReport===3" content="未通过" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateCandidateReport" @click="doit(scope.row.personId,12)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateCandidateReport===1">
              <el-tooltip v-if="scope.row.receiveUserName12" :content="scope.row.receiveUserName12+' 正在办理'" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,12)" class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,12)" class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateCandidateReport===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,12)"></i>
              </el-tooltip>
              <i @click="doit(scope.row.personId,12)" v-else  class="custom icon_c_0"></i>
            </div>
            <i @click="doit(scope.row.personId,12)" v-else :class="'custom icon_c_'+scope.row.stateCandidateReport"></i>
          </template>
        </el-table-column>
        <el-table-column label="计划下达" width="100">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateRecommend===2" content="确定为考察对象" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateRecommend" @click="tuijiandetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.stateRecommend===3" content="未确定考察对象，干部选任终止" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateRecommend" @click="tuijiandetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateRecommend===1">
              <el-tooltip v-if="scope.row.receiveUserName3" :content="scope.row.receiveUserName3+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateRecommend===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,3)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateRecommend"></i>
          </template>
        </el-table-column>
        <el-table-column label="岗位对接方案" width="120">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateExamination===2" content="考察完成通过提请审议" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateExamination" @click="kaochadetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.stateExamination===3" content="考察未通过" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateExamination" @click="kaochadetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateExamination===1">
              <el-tooltip v-if="scope.row.receiveUserName4" :content="scope.row.receiveUserName4+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateExamination===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,4)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateExamination"></i>
          </template>
        </el-table-column>
        <el-table-column label="招聘公告" width="100">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.statePublicity===2" class="item" effect="dark" :content="scope.row.tips===1?'有举报不影响任命':'无举报不影响任命'" placement="top" :open-delay="600">
              <!-- <i :class="'custom icon_c_'+scope.row.statePublicity" @click="$router.push({path: '/selection/gongshif/'+scope.row.personId})"></i> -->
              <i :class="'custom icon_c_'+scope.row.statePublicity" @click="gongshidetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.statePublicity===3" class="item" effect="dark" :content="scope.row.tips===1?'有举报影响任命':'无举报影响任命'" placement="top" :open-delay="600">
              <!-- <i :class="'custom icon_c_'+scope.row.statePublicity" @click="$router.push({path: '/selection/gongshif/'+scope.row.personId})"></i> -->
              <i :class="'custom icon_c_'+scope.row.statePublicity" @click="gongshidetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.statePublicity===1">
              <el-tooltip v-if="scope.row.receiveUserName6" :content="scope.row.receiveUserName6+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else content="监督处 正在办理" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.statePublicity===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部监督处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,6)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.statePublicity"></i>
          </template>
        </el-table-column>
        <el-table-column label="面试考官备案" width="120">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateManageOpinion===2" content="办理完成" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateManageOpinion" @click="manageOpiniondetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.stateManageOpinion===3" content="未通过" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateManageOpinion" @click="manageOpiniondetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateManageOpinion===1">
              <el-tooltip v-if="scope.row.receiveUserName13" :content="scope.row.receiveUserName13+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateManageOpinion===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,13)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateManageOpinion"></i>
          </template>
        </el-table-column>
        <el-table-column label="面试成绩上传" width="120">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateRecord===2" class="item" effect="dark" :content="scope.row.passed===1?'报部完成，结果：同意':'报部完成'" placement="top" :open-delay="600">
              <!-- <i :class="'custom icon_c_'+scope.row.stateRecord" @click="$router.push({path: '/selection/baobeif/'+scope.row.personId})"></i> -->
              <i :class="'custom icon_c_'+scope.row.stateRecord" @click="baobeidetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.stateRecord===3" class="item" effect="dark" :content="scope.row.passed===0?'报部完成，结果：不同意':'报部完成'" placement="top" :open-delay="600">
              <!-- <i :class="'custom icon_c_'+scope.row.stateRecord" @click="$router.push({path: '/selection/baobeif/'+scope.row.personId})"></i> -->
              <i :class="'custom icon_c_'+scope.row.stateRecord" @click="baobeidetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateRecord===1">
              <el-tooltip v-if="scope.row.receiveUserName7" :content="scope.row.receiveUserName7+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateRecord===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,7)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateRecord"></i>
          </template>
        </el-table-column>
        <el-table-column label="拟聘人选公示" width="120">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.statePostDispatch===2" class="item" effect="dark" :content="'任职文号：'+scope.row.docno" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.statePostDispatch" @click="fawendetail(scope.row.personId)"></i>
            </el-tooltip>
            <el-tooltip v-else-if="scope.row.statePostDispatch===3" class="item" effect="dark" :content="'任职文号：'+scope.row.docno" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.statePostDispatch" @click="fawendetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.statePostDispatch===1">
              <el-tooltip v-if="scope.row.receiveUserName8" :content="scope.row.receiveUserName8+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.statePostDispatch===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,8)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.statePostDispatch"></i>
          </template>
        </el-table-column>
        <el-table-column label="聘用人选备案" width="120">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateTalkBeforeAppointment===2||scope.row.stateTalkBeforeAppointment===3" class="item" effect="dark" :content="'谈话时间：'+scope.row.talkTime+' 谈话人：'+scope.row.talkPerson" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateTalkBeforeAppointment" @click="tanhuadetail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateTalkBeforeAppointment===1">
              <el-tooltip v-if="scope.row.receiveUserName9" :content="scope.row.receiveUserName9+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateTalkBeforeAppointment===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,9)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateTalkBeforeAppointment"></i>
          </template>
        </el-table-column>
        <el-table-column label="落户备案" width="100">
          <template slot-scope="scope">
            <el-tooltip v-if="scope.row.stateTalkHonestGovernment===2||scope.row.stateTalkHonestGovernment===3" class="item" effect="dark" :content="'谈话时间：'+scope.row.talkTime2+' 谈话人：'+scope.row.talkPerson2" placement="top" :open-delay="600">
              <i :class="'custom icon_c_'+scope.row.stateTalkHonestGovernment" @click="tanhua2detail(scope.row.personId)"></i>
            </el-tooltip>
            <div v-else-if="scope.row.stateTalkHonestGovernment===1">
              <el-tooltip v-if="scope.row.receiveUserName10" :content="scope.row.receiveUserName10+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
              <el-tooltip v-else :content="chuzhangid2name(scope.row.dataCreateUserId)+' 正在办理'" placement="top" :open-delay="600">
                <i class="custom icon_c_1"></i>
              </el-tooltip>
            </div>
            <div v-else-if="scope.row.stateTalkHonestGovernment===0">
              <el-tooltip v-if="inRoles('ROLE_chuzhang')&&(unitName === '干部一处'||unitName === '干部二处'||unitName === '干部三处')" class="custom icon_c_0" content="开始办理" placement="top" :open-delay="600">
                <i @click="doit(scope.row.personId,10)"></i>
              </el-tooltip>
              <i v-else  class="custom icon_c_0"></i>
            </div>
            <i v-else :class="'custom icon_c_'+scope.row.stateTalkHonestGovernment"></i>
          </template>
        </el-table-column>
      </el-table>
    <div class="block" style="background:#F5F7FA;overflow:hidden">
      <el-pagination :total="totalnum" :page-size="pageSize" @current-change="handleCurrentChange" :current-page="pageNum" @size-change="handleSizeChange" :page-sizes="[10, 20, 30, 50]" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
      <div id="legent">
        <!-- <div><b>图例</b></div> -->
        <i class="custom icon_c_0"></i><div>未办理</div>
        <i class="custom icon_c_-1"></i><div>无需办理</div>
        <!-- <i class="custom icon_c_1"></i><div>正在办理</div> -->
        <i class="custom icon_c_4"></i><div>部分完成</div>
        <i class="custom icon_c_2"></i><div>已完成</div>
      </div>
    </div>
    </section>
  </div>
</template>

<script>
export default {
  data () {
    return {
      timestamp: '',
      selectStepVisible: false,
      changeType: '',
      substep: '',
      dongyipersonId: '',
      steppersonId: '',
      candidateReportpersonId: '',
      manageOpinionpersonId: '',
      necessarypersonId: '',
      tuijianpersonId: '',
      kaochapersonId: '',
      taolunpersonId: '',
      gongshipersonId: '',
      baobeipersonId: '',
      fawenpersonId: '',
      tanhuapersonId: '',
      tanhua2personId: '',
      xuanbupersonId: '',
      guidangpersonId: '',
      candidateReportdetailshow: false,
      manageOpiniondetailshow: false,
      necessarydetailshow: false,
      tuijiandetailshow: false,
      kaochadetailshow: false,
      taolundetailshow: false,
      gongshidetailshow: false,
      baobeidetailshow: false,
      fawendetailshow: false,
      tanhuadetailshow: false,
      tanhua2detailshow: false,
      xuanbudetailshow: false,
      guidangdetailshow: false,
      personId: '',
      dongyidetailshow: false,
      jdcchuzhang: '',
      chuzhangs: [],
      tasknum: '',
      filters: {
        status: 1,
        personName: '',
        unitName: '',
        year: null
      },
      selectionlist: [],
      totalnum: 0,
      pageNum: 1,
      pageSize: 20,
      listLoading: true,
      changeSizeFlag: false,
      unitName: '',
      necessaryItems: [],
      mangeDep: [],
      tableHeight: 100,
      userRoles: '',
      jdcuserlist: [],
      jdcsetting: [],
      jdc1: '',
      jdc2: '',
      jdc3: '',
      jdc4: '',
      username: ''
    }
  },
  methods: {
    doit (personId, step) {
      this.$router.push({name: 'recruitUnit', params: {step: 1, selectPersonId: personId}})
      // if (step === 2) {
      //   // this.$router.push({name: 'selectionNecessary', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 3) {
      //   this.$router.push({name: 'tuijian', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 4) {
      //   this.$router.push({name: 'kaocha', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 5) {
      //   this.$router.push({name: 'taolun', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 6) {
      //   this.$router.push({name: 'gongshi', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 7) {
      //   this.$router.push({name: 'baobei', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 8) {
      //   this.$router.push({name: 'fawen', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 9) {
      //   this.$router.push({name: 'selectionTanhua', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 10) {
      //   this.$router.push({name: 'selectionTanhua2', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 11) {
      //   this.$router.push({name: 'selectionXuanbu', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 12) {
      //   this.$router.push({name: 'candidateReport', params: {step: 1, selectPersonId: personId}})
      // }
      // if (step === 13) {
      //   this.$router.push({name: 'manageOpinion', params: {step: 1, selectPersonId: personId}})
      // }
    },
    closeAndRefreshSteps () {
      this.selectStepVisible = false
      this.getList()
    },
    selectStep (data) {
      this.selectStepVisible = true
      this.steppersonId = data.personId
      this.changeType = data.changeType
    },
    getAllNum () {
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/selection/home/getTodoStatNum`)
        .then(response => {
          if (response.data.success && response.data.result) {
            this.tasknum = response.data.result
          }
        })
        .catch(error => {
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    sendofflist () {
      this.$router.push({path: '/selection/sendofflist'})
    },
    dongyishow (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.dongyipersonId = id
        this.dongyidetailshow = true
      }
    },
    candidateReportdetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.candidateReportdetailshow = true
        this.candidateReportpersonId = id
      }
    },
    manageOpiniondetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.manageOpiniondetailshow = true
        this.manageOpinionpersonId = id
      }
    },
    necessarydetail (id, substep) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && this.mangeDep.indexOf('干部监督处') > -1) ||
        (this.inRoles('ROLE_chuzhang') && this.unitName === '干部监督处')
      ) {
        this.necessarydetailshow = true
        this.necessarypersonId = id
        this.substep = substep
      }
    },
    tuijiandetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.tuijiandetailshow = true
        this.tuijianpersonId = id
      }
    },
    kaochadetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.kaochadetailshow = true
        this.kaochapersonId = id
      }
    },
    taolundetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.taolundetailshow = true
        this.taolunpersonId = id
      }
    },
    gongshidetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && this.mangeDep.indexOf('干部监督处') > -1) ||
        (this.inRoles('ROLE_chuzhang') && this.unitName === '干部监督处')
      ) {
        this.gongshidetailshow = true
        this.gongshipersonId = id
      }
    },
    baobeidetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.baobeidetailshow = true
        this.baobeipersonId = id
      }
    },
    fawendetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.fawendetailshow = true
        this.fawenpersonId = id
      }
    },
    tanhuadetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.tanhuadetailshow = true
        this.tanhuapersonId = id
      }
    },
    tanhua2detail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.tanhua2detailshow = true
        this.tanhua2personId = id
      }
    },
    xuanbudetail (id) {
      if (
        this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') ||
        (this.inRoles('ROLE_fusizhang') && (this.mangeDep.indexOf('干部一处') > -1 || this.mangeDep.indexOf('干部二处') > -1 || this.mangeDep.indexOf('干部三处') > -1)) ||
        (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))
      ) {
        this.xuanbudetailshow = true
        this.xuanbupersonId = id
      }
    },
    guidangdetail (id) {
      this.timestamp = new Date().getTime()
      this.guidangdetailshow = true
      this.guidangpersonId = id
    },
    dongyi () {
      this.$router.push({path: '/selection/dongyi/0'})
    },
    inRoles (str) {
      console.log(str)
      let arr = this.userRoles
      // arr = 'aaabbROLE_admin'
      if (arr.indexOf(str) === -1) {
        return false
      } else {
        return true
      }
    },
    tasklist () {
      if (this.inRoles('ROLE_banshirenyuan')) {
        if (this.unitName === '干部监督处') {
          this.$router.push({path: '/selection/taskjdccn'})
        } else {
          this.$router.push({path: '/selection/taskcn'})
        }
      } else if (this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_fusizhang')) {
        this.$router.push({path: '/selection/taskleader'})
      } else if (this.inRoles('ROLE_chuzhang')) {
        if (this.unitName === '干部监督处') {
          this.$router.push({path: '/selection/taskjdc'})
        } else {
          this.$router.push({path: '/selection/task'})
        }
      }
    },
    handleSizeChange (val) {
      this.changeSizeFlag = true
      this.pageNum = 1
      this.pageSize = val
      this.getList()
    },
    handleCurrentChange (val) {
      if (this.changeSizeFlag === false) {
        this.pageNum = val
        this.getList()
      }
    },
    searchList () {
      this.pageNum = 1
      this.getList()
    },
    unitName2id (str) {
      if (str === '干部一处') {
        return 1
      } else if (str === '干部二处') {
        return 2
      } else if (str === '干部三处') {
        return 3
      }
    },
    getList () {
      let departmentCodes = [0]
      if (this.inRoles('ROLE_chuzhang') || this.inRoles('ROLE_banshirenyuan')) {
        if (this.unitName2id(this.unitName)) {
          departmentCodes = [this.unitName2id(this.unitName)]
        } else {
          departmentCodes = null
        }
      }
      if (this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin') || this.inRoles('ROLE_fusizhang')) {
        departmentCodes = []
        this.mangeDep = localStorage.getItem('mangeDep')
        if (!this.mangeDep || this.mangeDep === '') {
          this.mangeDep = []
        }
        if (this.mangeDep.indexOf('干部一处') > -1) {
          departmentCodes.push(1)
        }
        if (this.mangeDep.indexOf('干部二处') > -1) {
          departmentCodes.push(2)
        }
        if (this.mangeDep.indexOf('干部三处') > -1) {
          departmentCodes.push(3)
        }
        if (this.inRoles('ROLE_sizhang') || this.inRoles('ROLE_admin')) {
          departmentCodes = [1, 2, 3]
        }
        if (this.mangeDep.indexOf('干部监督处') > -1) {
          departmentCodes = [1, 2, 3]
          // if (departmentCodes.length === 0) {
          //   this.$router.push({path: '/selection/taskleader'})
          // }
        }
      }
      let para = {
        state: this.filters.status,
        realName: this.filters.personName,
        unitName: this.filters.unitName,
        year: this.filters.year,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        departmentCodes: departmentCodes
      }
      if (this.inRoles('ROLE_sizhang') || (this.inRoles('ROLE_chuzhang') && (this.unitName === '干部一处' || this.unitName === '干部二处' || this.unitName === '干部三处'))) {
        para.onlyMine = false
      } else {
        para.onlyMine = true
      }
      var _this = this
      this.listLoading = true
      this.$http
        .post(this.$http.defaults.selectionAPI + `api/selection/home/getPersonAllStepsInfo`, para)
        .then(function (response) {
          _this.listLoading = false
          // _this.selectionlist = response.data.result.records
          _this.selectionlist = [
            {
              'personId': 17,
              'busChangeProposalId': 17,
              'busPostId': 17,
              'dataCreateUserId': 23,
              'dataCreateUserRealName': '干部一处处长',
              'meetingTime': '2021-11-01',
              'meetingNumber': 1,
              'realName': '张三',
              'unitName': '自然资源部北海局',
              'jobName': '主任 测试职务',
              'jobLevel': '一级巡视员',
              'candidateUnit': '中国自然资源经济研究院',
              'currentJob': ' ',
              'currentLevel': '',
              'idcardNo': '131002198008114213',
              'stateChangeResult': 2,
              'stateCadreArchives': 0,
              'statePersonalMatters': 0,
              'stateSolicitingOpinions': 0,
              'stateClueReporting': 0,
              'stateRecommend': -1,
              'stateExamination': -1,
              'stateDecisionMeeting': 0,
              'statePublicity': -1,
              'stateRecord': -1,
              'statePostDispatch': -1,
              'stateTalkBeforeAppointment': -1,
              'stateTalkHonestGovernment': -1,
              'stateDeclare': 0,
              'stateFiled': 1,
              'receiveUserName1': '监督处处长',
              'stateCandidateReport': -1,
              'stateManageOpinion': -1,
              'changeType': '1501',
              'changeTypeText': '提任',
              'children': [
                {
                  'personId': 16,
                  'busChangeProposalId': 16,
                  'busPostId': 16,
                  'dataCreateUserId': 23,
                  'dataCreateUserRealName': '干部一处处长',
                  'ftsbState': 1,
                  'meetingTime': '2021-07-01',
                  'meetingNumber': 2,
                  'realName': '2132',
                  'unitName': '北海局下属事业单位1',
                  'jobName': '司长 2132132',
                  'jobLevel': '',
                  'candidateUnit': '13213213',
                  'currentJob': '局长 111',
                  'currentLevel': '',
                  'idcardNo': '131002198008114213',
                  'stateChangeResult': 2,
                  'stateCadreArchives': 1,
                  'statePersonalMatters': 2,
                  'resultPersonalMatters': '无',
                  'stateSolicitingOpinions': 1,
                  'stateClueReporting': 1,
                  'stateRecommend': 2,
                  'stateExamination': 2,
                  'stateDecisionMeeting': 2,
                  'reportDate': '2021-11-01',
                  'meetingTimes': 1,
                  'meetingDate': '2021-11-03',
                  'meetingType': 2,
                  'statePublicity': 2,
                  'meetingDate2': '2021-11-03',
                  'meetingTimes2': 2,
                  'dateStart': '2021-11-08',
                  'dateEnd': '2021-11-15',
                  'stateRecord': -1,
                  'statePostDispatch': 0,
                  'stateTalkBeforeAppointment': 0,
                  'stateTalkHonestGovernment': 0,
                  'stateDeclare': 0,
                  'stateFiled': 1,
                  'stateCandidateReport': 2,
                  'stateManageOpinion': 0,
                  'changeType': '1505',
                  'changeTypeText': '其他'
                },
                {
                  'personId': 15,
                  'busChangeProposalId': 15,
                  'busPostId': 15,
                  'dataCreateUserId': 25,
                  'dataCreateUserRealName': '干部三处处长',
                  'meetingTime': '2021-07-01',
                  'meetingNumber': 1,
                  'realName': '三处2',
                  'unitName': '北海局下属事业单位2',
                  'jobName': '司长 22',
                  'jobLevel': '一级调研员',
                  'candidateUnit': '三处',
                  'currentJob': ' ',
                  'currentLevel': '',
                  'idcardNo': '110108196101232230',
                  'stateChangeResult': 2,
                  'stateCadreArchives': 0,
                  'statePersonalMatters': 0,
                  'stateSolicitingOpinions': 0,
                  'stateClueReporting': 0,
                  'stateRecommend': 2,
                  'stateExamination': -1,
                  'stateDecisionMeeting': 0,
                  'statePublicity': 2,
                  'stateRecord': -1,
                  'statePostDispatch': 0,
                  'stateTalkBeforeAppointment': 0,
                  'stateTalkHonestGovernment': -1,
                  'stateDeclare': 0,
                  'stateFiled': 1,
                  'receiveUserName1': '监督处处长',
                  'stateCandidateReport': 2,
                  'stateManageOpinion': 0,
                  'changeType': '1501',
                  'changeTypeText': '提任'
                },
                {
                  'personId': 14,
                  'busChangeProposalId': 15,
                  'busPostId': 15,
                  'dataCreateUserId': 25,
                  'dataCreateUserRealName': '干部三处处长',
                  'ftsbState': 3,
                  'meetingTime': '2021-07-01',
                  'meetingNumber': 1,
                  'realName': '三处1',
                  'unitName': '北海局下属事业单位3',
                  'jobName': '司长 22',
                  'jobLevel': '一级调研员',
                  'candidateUnit': '三处',
                  'currentJob': ' ',
                  'currentLevel': '',
                  'idcardNo': '131002198008114213',
                  'stateChangeResult': 2,
                  'stateCadreArchives': 2,
                  'resultCadreArchives': '无',
                  'statePersonalMatters': 2,
                  'resultPersonalMatters': '无',
                  'stateSolicitingOpinions': 2,
                  'resultSolicitingOpinions': '征求驻部纪检检查组意见后处理意见：22222，征求机关纪委意见后处理意见：无',
                  'stateClueReporting': 2,
                  'resultClueReporting': '无',
                  'stateRecommend': 2,
                  'stateExamination': -1,
                  'stateDecisionMeeting': 0,
                  'statePublicity': 2,
                  'stateRecord': -1,
                  'statePostDispatch': 0,
                  'stateTalkBeforeAppointment': 0,
                  'stateTalkHonestGovernment': -1,
                  'stateDeclare': 0,
                  'stateFiled': 1,
                  'receiveUserName2': '主管监督处副司长',
                  'stateCandidateReport': 2,
                  'stateManageOpinion': 0,
                  'changeType': '1501',
                  'changeTypeText': '提任'
                } ]
            },
            {
              'personId': 13,
              'busChangeProposalId': 14,
              'busPostId': 14,
              'dataCreateUserId': 24,
              'dataCreateUserRealName': '',
              'ftsbState': 1,
              'meetingTime': '2021-07-14',
              'meetingNumber': 1,
              'realName': '0713二处2',
              'unitName': '中国自然资源经济研究院',
              'jobName': ' 111',
              'jobLevel': '',
              'candidateUnit': '333',
              'currentJob': ' ',
              'currentLevel': '',
              'idcardNo': '131002198008114213',
              'stateChangeResult': 2,
              'stateCadreArchives': 1,
              'statePersonalMatters': 2,
              'resultPersonalMatters': '无',
              'stateSolicitingOpinions': 1,
              'stateClueReporting': 1,
              'stateRecommend': 0,
              'stateExamination': -1,
              'stateDecisionMeeting': 0,
              'statePublicity': 4,
              'stateRecord': 0,
              'statePostDispatch': 4,
              'stateTalkBeforeAppointment': 0,
              'stateTalkHonestGovernment': -1,
              'stateDeclare': 0,
              'stateFiled': 1,
              'stateCandidateReport': 2,
              'stateManageOpinion': 2,
              'changeType': '1501',
              'changeTypeText': '提任'
            },
            {
              'personId': 12,
              'busChangeProposalId': 14,
              'busPostId': 14,
              'dataCreateUserId': 24,
              'dataCreateUserRealName': '',
              'ftsbState': 1,
              'meetingTime': '2021-07-14',
              'meetingNumber': 1,
              'realName': '0713二处1',
              'unitName': '自然资源部不动产登记中心（自然资源部法律事务中心）',
              'jobName': ' 111',
              'jobLevel': '',
              'candidateUnit': '222',
              'currentJob': ' ',
              'currentLevel': '',
              'idcardNo': '131002198008114213',
              'stateChangeResult': 2,
              'stateCadreArchives': 1,
              'statePersonalMatters': 2,
              'resultPersonalMatters': '无',
              'stateSolicitingOpinions': 1,
              'stateClueReporting': 1,
              'stateRecommend': 0,
              'stateExamination': 0,
              'stateDecisionMeeting': 0,
              'statePublicity': 0,
              'stateRecord': 0,
              'statePostDispatch': 0,
              'stateTalkBeforeAppointment': 0,
              'stateTalkHonestGovernment': 0,
              'stateDeclare': 0,
              'stateFiled': 1,
              'stateCandidateReport': 0,
              'stateManageOpinion': 0,
              'changeType': '1501',
              'changeTypeText': '提任'
            },
            {
              'personId': 11,
              'busChangeProposalId': 13,
              'busPostId': 13,
              'dataCreateUserId': 23,
              'dataCreateUserRealName': '干部一处处长',
              'ftsbState': 1,
              'meetingTime': '2021-07-01',
              'meetingNumber': 1,
              'realName': '0713b',
              'unitName': '中国地质调查局',
              'jobName': ' 111',
              'jobLevel': '',
              'candidateUnit': '测试单位诶诶1',
              'currentJob': ' ',
              'currentLevel': '',
              'idcardNo': '131002198008114213',
              'stateChangeResult': 2,
              'stateCadreArchives': 1,
              'statePersonalMatters': 0,
              'resultPersonalMatters': '111',
              'stateSolicitingOpinions': 2,
              'resultSolicitingOpinions': '征求驻部纪检检查组意见后处理意见：123，征求机关纪委意见后处理意见：无',
              'stateClueReporting': 1,
              'stateRecommend': 2,
              'stateExamination': 0,
              'stateDecisionMeeting': 1,
              'reportDate': '2021-11-01',
              'statePublicity': -1,
              'stateRecord': -1,
              'statePostDispatch': -1,
              'stateTalkBeforeAppointment': 0,
              'stateTalkHonestGovernment': 0,
              'stateDeclare': 0,
              'stateFiled': 1,
              'stateCandidateReport': 2,
              'stateManageOpinion': -1,
              'changeType': '1501',
              'changeTypeText': '提任',
              'children': [
                {
                  'personId': 10,
                  'busChangeProposalId': 13,
                  'busPostId': 13,
                  'dataCreateUserId': 23,
                  'dataCreateUserRealName': '干部一处处长',
                  'ftsbState': 1,
                  'meetingTime': '2021-07-01',
                  'meetingNumber': 1,
                  'realName': '0713b',
                  'unitName': '中国地质调查局',
                  'jobName': ' 111',
                  'jobLevel': '',
                  'candidateUnit': '测试单位诶诶1',
                  'currentJob': ' ',
                  'currentLevel': '',
                  'idcardNo': '131002198008114213',
                  'stateChangeResult': 2,
                  'stateCadreArchives': 1,
                  'statePersonalMatters': 0,
                  'resultPersonalMatters': '111',
                  'stateSolicitingOpinions': 2,
                  'resultSolicitingOpinions': '征求驻部纪检检查组意见后处理意见：123，征求机关纪委意见后处理意见：无',
                  'stateClueReporting': 1,
                  'stateRecommend': 2,
                  'stateExamination': -1,
                  'stateDecisionMeeting': 1,
                  'reportDate': '2021-11-01',
                  'statePublicity': -1,
                  'stateRecord': -1,
                  'statePostDispatch': -1,
                  'stateTalkBeforeAppointment': 0,
                  'stateTalkHonestGovernment': -1,
                  'stateDeclare': 0,
                  'stateFiled': 1,
                  'stateCandidateReport': 2,
                  'stateManageOpinion': -1,
                  'changeType': '1501',
                  'changeTypeText': '提任'
                }]
            }
          ]
          _this.totalnum = response.data.result.total
          _this.changeSizeFlag = false
          _this.listLoading = false
        })
        .catch(function (error) {
          _this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
          _this.listLoading = false
        })
    },
    getdept () {
      var _this = this
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/selection/auth/getDepartments`)
        .then(function (response) {
          console.log('response.data.result')
          console.log(response.data.result)
          // 需要转成全局变量
          _this.userRoles = ''
          _this.userRoles = JSON.parse(localStorage.getItem('Roles'))
          if (response.data.success && response.data.result) {
            if (response.data.result.unitName) {
              _this.unitName = response.data.result.unitName
              localStorage.setItem('unitName', response.data.result.unitName)
            }
            if (response.data.result.necessaryItems) {
              _this.necessaryItems = response.data.result.necessaryItems
              localStorage.setItem('necessaryItems', response.data.result.necessaryItems)
            }
            if (response.data.result.mangeDep) {
              if (_this.inRoles('ROLE_sizhang') || _this.inRoles('ROLE_admin')) {
                console.log('此人为正司长')
                _this.mangeDep = ['干部一处', '干部二处', '干部三处', '干部监督处']
              } else {
                _this.mangeDep = response.data.result.mangeDep
              }
              localStorage.setItem('mangeDep', _this.mangeDep)
              console.log(localStorage.getItem('mangeDep'))
            }
            _this.checkjdc()
            _this.getList()
          }
        })
        .catch(function (error) {
          _this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    tableresize (obj) {
      var clientHeight = 0
      if (document.body.clientHeight && document.documentElement.clientHeight) {
        clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      } else {
        clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
      }
      obj.$nextTick(function () {
        obj.tableHeight = clientHeight - 292
      })
    },
    checkjdc () {
      console.log('任免首页检查roles')
      console.log(this.userRoles)
      this.unitName = localStorage.getItem('unitName')
      if (this.inRoles('ROLE_banshirenyuan')) {
        console.log('jdccheck1' + this.unitName)
        if (this.unitName === '干部监督处') {
          // this.$router.push({path: '/selection/taskjdccn'})
        } else {
          // this.$router.push({path: '/selection/taskcn'})
        }
      } else if (this.inRoles('ROLE_chuzhang')) {
        console.log('jdccheck2' + this.unitName)
        if (this.unitName === '干部监督处') {
          console.log('jdccheck2' + this.unitName)
          // this.$router.push({path: '/selection/taskjdc'})
        }
      }
    },
    getJDCname () {
      this.loadJDCuserlist()
    },
    jdcid2name (id) {
      for (let i = 0; i < this.jdcuserlist.length; i++) {
        console.log('监督处办事人员：' + this.jdcuserlist[i].userId)
        if (this.jdcuserlist[i].userId === id) {
          return this.jdcuserlist[i].realName
        }
      }
    },
    loadJDCuserlist () {
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/selection/auth/getSupervisionPersons`)
        .then(response => {
          if (response.data.success) {
            this.jdcuserlist = response.data.result
            this.loadJDCsetting()
          } else {
            this.$message({
              message: '读取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络读取失败:' + error,
            type: 'error'
          })
        })
    },
    loadJDCsetting () {
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/selection/auth/getNecessaryItems`)
        .then(response => {
          if (response.data.success) {
            if (response.data.result) {
              this.jdcsetting = response.data.result
              this.jdc1 = this.jdcid2name(this.jdcsetting.userId1)
              this.jdc2 = this.jdcid2name(this.jdcsetting.userId2)
              this.jdc3 = this.jdcid2name(this.jdcsetting.userId3)
              this.jdc4 = this.jdcid2name(this.jdcsetting.userId4)
              console.log('jdc1' + this.jdc1)
              console.log('jdc2' + this.jdc2)
              console.log('jdc3' + this.jdc3)
              console.log('jdc4' + this.jdc4)
            }
          } else {
            this.$message({
              message: '读取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络读取失败:' + error,
            type: 'error'
          })
        })
    },
    getChuzhangs () {
      this.$http
        .get(this.$http.defaults.selectionAPI + `api/selection/auth/getUsersByRole?roletype=1`)
        .then(response => {
          if (response.data.success) {
            this.chuzhangs = response.data.result
            this.getJDCchuzhang()
            // console.log(JSON.stringify(this.chuzhangs))
            // console.log('处长id1name:' + this.chuzhangid2name(5))
          } else {
            this.$message({
              message: '获取失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '获取失败:' + error,
            type: 'error'
          })
        })
    },
    chuzhangid2name (id) {
      let realname = ''
      for (let i = 0; i < this.chuzhangs.length; i++) {
        // console.log('处长：' + this.chuzhangs[i].value)
        if (this.chuzhangs[i].value === id) {
          realname = this.chuzhangs[i].name
        }
      }
      if (realname === '') {
        return localStorage.getItem('userTrueName')
      } else {
        return realname
      }
    },
    getJDCchuzhang () {
      for (let i = 0; i < this.chuzhangs.length; i++) {
        if (this.chuzhangs[i].unitName === '干部监督处') {
          this.jdcchuzhang = this.chuzhangs[i].name
          console.log('监督处处长：' + this.jdcchuzhang)
        }
      }
    }
  },
  mounted () {
    // let mydate = new Date()
    // this.filters.year = mydate.getFullYear().toString()
    this.getAllNum()
    this.username = localStorage.getItem('userTrueName')
    this.getChuzhangs()
    this.getJDCname()
    this.getdept()
    this.tableresize(this)
    let _this = this
    window.onresize = function windowResize () {
      // 通过捕获系统的onresize事件触发我们需要执行的事件
      _this.tableresize(_this)
    }
  }
}
</script>
<style>
.selectioncontent{
  border-bottom:1px solid #333;
  padding:5px !important;
}
  .pointtab .el-badge__content.is-fixed{
    right: -5px;
    top:18px;
  }
  .pointtab{
    padding-right:22px;
  }
  .pointRadio .el-badge__content.is-fixed{
    right: -5px;
    top:6px;
  }
  .pointRadio .el-radio-button__inner{
    height:40px;
    padding-left:15px;
    padding-right:42px;
  }
#recruitlist .el-table--border td, .el-table--border th, .el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{
  border-bottom:1px solid #95B8E7;
}
#recruitlist .el-table td, .el-table th.is-leaf{
  border-right:1px solid #95B8E7;
}
  .wboxd .el-table th{
    font-weight: normal;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    text-align: center;
    border-right: #95B8E7 solid 1px;
    border-bottom: #95B8E7 solid 1px;
    min-height: 30px;
    line-height:30px;
  }
  .wboxd .el-table td, .el-table th{
    padding:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体',
  }
  .tableth{
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    height:33px;
  }
  #recruitlist .wboxs{
    height:45px;
    padding-top:10px;
  }
  #recruitlist .el-table__row{
    height: 50px;
  }
  #recruitlist #legent{
    float:right;
    margin-right: 20px;
  }
  #recruitlist #legent div{
    float:left;
    line-height: 42px;
    font-size:var(--size12);
  }
  #recruitlist #legent i{
    width: 30px;
    height: 30px;
    background-position: center center;
    background-repeat: no-repeat;
    float: left;
    display: block;
    margin:5px 0px 0 3px;
  }
  #recruitlist #selectionindexlist .cell i.custom{
    width: 30px;
    height: 30px;
    background-position: center center;
    background-repeat: no-repeat;
    float: center;
    display: block;
    cursor: pointer;
    margin:0 auto;
  }
  #recruitlist #selectionindexlist .cell button i{
    width: var(--size14);
    height: var(--size14);
  }
  #recruitlist .icon_c_0{
    background-image: url(../assets/icon_selection_index0.png)
  }
  #recruitlist .icon_c_1{
    background-image: url(../assets/icon_selection_index2.gif)
  }
  #recruitlist .icon_c_2{
    background-image: url(../assets/icon_selection_index1.png)
  }
  #recruitlist .icon_c_-1{
    background-image: url(../assets/icon_selection_index-1.png)
  }
  #recruitlist .icon_c_3{
    background-image: url(../assets/icon_selection_index3.png)
  }
  #recruitlist .icon_c_3a{
    background-image: url(../assets/icon_selection_index4t.png)
  }
  #recruitlist .icon_c_3b{
    background-image: url(../assets/icon_selection_index3b.png)
  }
  #recruitlist .icon_c_4{
    background-image: url(../assets/icon_selection_index4t.png)
  }
  #recruitlist .icon_c_5{
    background-image: url(../assets/icon_selection_index4r.png)
  }
  #recruitlist .icon_gd_0{
    background-image: url(../assets/icon_selection_gd0.png)
  }
  #recruitlist .icon_gd_1{
    background-image: url(../assets/icon_selection_gd1.gif)
  }
  #recruitlist .icon_gd_2{
    background-image: url(../assets/icon_selection_gd2.png)
  }
  #recruitlist .icon_gd_4{
    background-image: url(../assets/icon_selection_gd4.png)
  }
  .el-tooltip__popper.is-dark{
    font-size:var(--size18) !important;
  }
  .el-tabs--card>.el-tabs__header {
    border-bottom: 1px solid #9CA3B3;
  }
  .el-tabs--card>.el-tabs__header .el-tabs__nav {
    border: 1px solid #9CA3B3;
    border-bottom: 0;
  }
  .el-tabs--card>.el-tabs__header .el-tabs__item {
    border-left: 1px solid #9CA3B3;
    /* background-color: #F0F0F0; */
  }
  .el-tabs__item.is-active {
    color: #0000FF !important;
    font-weight: bolder !important;
    /* background-color: #fff !important; */
    /* border-bottom: 2px solid #9CA3B3 !important; */
  }
</style>
<style scoped>
  .el-tooltip__popper{
    font-size:var(--size) !important;
  }
  h1{
    font-size:var(--size16) !important;
    font-weight: bolder;
    height: 30px;
    border-bottom: 1px solid #95B8E7;
    font-family: '宋体';
    line-height: 30px;
    color: #000;
    padding-left:10px;
    background-image: linear-gradient(to bottom , #EEF4FF, #E0ECFF);
    margin:0;
  }
  .el-pagination{
    float: left;
    padding:7px 10px;
  }
  .wboxs{
    padding:5px 15px;
    width: calc(100% - 30px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
  .wboxd{
    padding:0;
    width: calc(100% - 0px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
</style>
